var {
	Crypto
} = require('./cryptojs-master/cryptojs.js');
export function CryptoencryptedData(encryptedData, iv, sessionKey) {
	// console.log(Crypto)
	var encryptedData = Crypto.util.base64ToBytes(encryptedData)
	// console.log(sessionKey)
	var key = Crypto.util.base64ToBytes(sessionKey);
	var iv = Crypto.util.base64ToBytes(iv);
	// console.log(encryptedData,key,iv)
	// 对称解密使用的算法为 AES-128-CBC，数据采用PKCS#7填充
	var mode = new Crypto.mode.CBC(Crypto.pad.pkcs7);
	try {
		// 解密
		var bytes = Crypto.AES.decrypt(encryptedData, key, {
			asBpytes: true,
			iv: iv,
			mode: mode
		});
		// console.log(bytes)
		var decryptResult = JSON.parse(bytes);

	} catch (err) {
		// console.log(err)
	}
	if (decryptResult.watermark.appid !== 'wx7a0c5e2e64ba22e8') {
		// console.log(err)
	}
	return decryptResult
}
